package com.smart.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smart.pojo.Role;
import com.smart.resp.RoleResp;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lyj
 * @since 2023-04-21
 */
public interface RoleMapper extends BaseMapper<Role> {

    @Select("select r.*,d.name departmentName\n" +
            "from role r\n" +
            "left join department d\n" +
            "on r.department_id=d.id ${ew.customSqlSegment}")
    Page<RoleResp> selectRoleRespPageByCondition(Page<RoleResp> rolePage, @Param("ew") QueryWrapper<Role> wrapper);
}
